package user

type UserService struct {
	userRepository UserRepository
}

func NewUserService(userRepository UserRepository) *UserService {
	return &UserService{
		userRepository: userRepository,
	}
}

func (t *UserService) Login(wxLoginCode string) (*UserEntity, error) {
	user, err := t.userRepository.Login(wxLoginCode)
	if err != nil {
		return nil, err
	}
	return user, nil
}
